namespace java tutorial

typedef i32 int 

struct Operacao {
  1: string operacao,
  2: list<string> argumentos,
}

struct Transacao {
  1: int client,
  2: list<Operacao> ops,
}

exception InvalidOperation {
  1: i32 what,
  2: string why
}

service ThriftPluresDB
{
  bool opRequestVote(1:int client, 2:Transacao transacao) throws (1:InvalidOperation ouch),
  bool opPrepareCommit(1:int client) throws (1:InvalidOperation ouch),
	bool opGlobalAbort(1:int client) throws (1:InvalidOperation ouch),
	bool opGlobalCommit(1:int client) throws (1:InvalidOperation ouch),

  string opEnter() throws (1:InvalidOperation ouch),
	string opUpdateServerFile(1:list<string> listaParticipantes) throws (1:InvalidOperation ouch),
  List<Transacao> getCommitted(1:int counter),
  bool updateData(1:list<Transacao> transacoes)
}
